<template>  
	<div class="basicBiangen"> 
		<!-- 变更信息照片 -->
		<div class="basicBiangen_img">
			<img src="../../../public/images/enterprise/bgjl@2x.png" alt="">
		</div>
		<div class="basicBiangen_content">
			<!-- 表格对应的4个圆点 -->
			<div class="lineRadius l1"></div>
			<div class="lineRadius l2"></div>
			<div class="lineRadius r1"></div>
			<div class="lineRadius r2"></div>
			<!-- 变更信息表格 -->
			<div class="Biangen_content_list">
				<div class="Biangen_time">
					<div class="Biangen_time_item" v-for="(item,index) in baseData" :key="index">
						<div class="Biangen_time_itemname">{{item.change_date}}</div>
					</div>
				</div>
				<div class="Biangen_line" >
					<div class="Biangen_line_item"  v-for="(item,index) in baseData" :key="index">
						<img src="../../../public/images/enterprise/qybgoff@2x.png" >
					</div>
				</div>
				<div class="Biangen_oldcontent">
					<div class="oldcontent_item" v-for="(item,index) in baseData" :key="index">
						<div class="oldcontent_itemname">
							<div class="oldcontent_itemname_type" v-if="item.change_type">{{item.change_type}}</div>
							{{item.change_before}}
						</div>
					</div>
				</div>
				<div class="Biangen_jiantou">
					<div class="jiantou_item" v-for="(item,index) in baseData" :key="index">
						<img  src="../../../public/images/enterprise/qiyeJianicon@2x.png" alt="">
					</div>
				</div>
				<div class="Biangen_newcontent">
					<div class="newcontent_item" v-for="(item,index) in baseData" :key="index">
						<div class="newcontent_itemname" >
							{{item.change_after}}
						</div>
					</div>
				</div>
			</div>
		</div>
	</div> 
</template>

<script>
	export default{
		data() {
			return{
				sbcompany:'',
				baseData:[]
			}
		}, 
		//变更记录过滤
		filters:{
			ellipsis(value, num) { 
			      if (value.length > num) {
			        return value.substring(0, num) + "...";
			      } else {
			        return value;
			      }
			    },
		},
		mounted() {
			this.getBasedata()
			this.sbcompany=this.$route.query.comname
			this.$bus.$on('updateComname',async (comname)=>{
				this.baseData=[
								{
                    "change_after": "",
                    "change_date": "",
                    "company_name": "",
                    "change_before": "",
                    "change_type": ""
                },
            ]
				this.sbcompany=comname
				this.getBasedata()
			})
		},
		methods:{
			// 获取变更信息数据
			async getBasedata(){
				this.baseData=[]
				var dt = {
					"params": {
						"normGuid": "0b7a9d55-0fcc-48b0-8956-97487d75428c",
							"fieldList": [{
					            "key":"company_name",
					            "value":this.sbcompany
					        }]
					}
				};
				const aaa = await this.$api.post('dcockpit/rest/cockpitApi/searchListNormResult', dt)
				let {custom:{result}}={...aaa}
				this.baseData=result.cockpitData
			},
		}
	}
</script>

<style lang="stylus" rel='stylesheet/stylus' scoped>
	@import "~@/assets/basicBiangen.styl"
</style>
